package com.xb.health.controller;

import com.xb.health.pojo.SysUser;
import com.xb.health.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/test")
    public String testQuery(){
        SysUser aaa = userService.queryUsername("aaa");
        log.info(">>>查询用户名：{}",aaa);

        List<SysUser> sysUsers = userService.queryUsers();
        log.info("查询多个：{}",sysUsers);

        return "ok";
    }
}
